package com.liesheng.haylou.base;

import com.liesheng.haylou.net.HttpCallback;
import com.liesheng.haylou.net.HttpService;

import rx.Observable;
import rx.Subscription;

/**
 * Date:2019/11/21
 * <p>
 * Author:wuzhiguang
 * <p>
 * Description:
 *          基础常用方法
 */
public interface IBaseFun {

    void showToast(String msg);
    void showToast(int strId);

    //动态申请权限
    void requestRunTimePermission(String[] permissions, PermissionListener listener);
    //显示加载框
    void showLoadingDialog() ;
    //显示加载框
    void showLoadingDialog(String msg) ;
    //隐藏加载框
    void dismissLoadingDialog() ;

    //添加subscription到列表中
    void addSubscription(Subscription subscription);
    //解绑subscription
    void unsubscribe();

    //接口请求
    <T extends BaseResult> void requestHttp(Observable<T> observable, final HttpCallback<T> callback);

    HttpService buildHttpService();
}
